package com.zeratul.common.mybatis.core.sqlexec.context;

import com.zeratul.common.core.context.DataContextHolde;

import static com.zeratul.common.core.constant.ContextConstants.SQL_LOG_KEY;

/**
 * SQL日志输出标志的上下文对象
 */
public class SqlContext {

    public static void setSqlLog(Boolean sqlLog) {
        DataContextHolde.setTraceData(SQL_LOG_KEY, sqlLog);
    }

    public static Boolean getSqlLog() {
        return DataContextHolde.getTraceData(SQL_LOG_KEY);
    }

    public static void clear() {
        DataContextHolde.removeTraceData(SQL_LOG_KEY);
    }
}
